<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        console.log("map方法")
        var arr1 = ['KFC', '麦当劳', '德克士']
        var brr1 = arr1.map(function(item, index) {
            return '第' + (index + 1) + '个' + item
        })
        console.log(brr1)
        console.log("*****")
        var arr = [{
            'name': 'a',
            'value': '1'
        }, {
            'name': 'b',
            'value': 2
        }];
        // 目标输出name: ['a', 'b'];
        // value: [1, 2]
        var name1 = arr.map(item => item.name)
        var name2 = arr.map(item => item.value);
        console.log(name1,name2)
        console.log("filter方法")
        var arr2=[20,30,24,28,26,22]
        var brr2=arr2.filter(function(item,index){
             return item < 25
        })
        console.log(brr2);
        console.log("返回布尔值")
        var arr2=[60,30,34,428,446,422]
        var brr3=arr2.some(function(item,index){
            return item >100
        })
        console.log(brr3)
        var brr4=arr.every(item=> item>50)
        console.log(brr4);
    </script>
</body>

</html>